<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/header.jsp" %>


<div class="row" id="userDiv">
   <div class="col-xs-12">
   		<div class="row">
   			<div class="col-xs-3">
   				<div id="orgTreeDiv"></div>
   			</div>
   			<div class="col-xs-9">
   				<div class="row">
   					<div class="col-xs-12">
   						<div id="queryInfoDiv"></div>   						
   					</div>
   				</div>
   				<div class="hr hr-18 dotted hr-double"></div>   				
   				<div class="row">
   					<div class="col-xs-12">
   						<div id="userListDiv"></div>   						
   					</div>
   				</div>    			
   			</div>
   		</div>
    </div>
</div>
<div id="userInfoDiv"></div>
<script type="text/javascript">
var scripts = [null, null];
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
        var param = {"checkType":"org","isCheckOrg":"0"};
    	$("#orgTreeDiv").load("${ctx}/org/haveRootNodes.do",param);
        $("#queryInfoDiv").load("${ctx}/user/toQuery.do" );
        $("#userListDiv").load("${ctx}/user/list.do" );
        
        $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
    		_title: function(title) {
    			var $title = this.options.title || '&nbsp;'
    			if( ("title_html" in this.options) && this.options.title_html == true )
    				title.html($title);
    			else title.text($title);
    		}
    	}));  
   
	//用户的详细信息列表	
		$('#userInfoDiv').dialog({
			hide : true,
			autoOpen : false,
			width : 700,
			height : 600,
			modal : true,
			title : "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-cog green'></i>&nbsp; 个人信息</h4></div>",
			title_html : true,
			open: function (event,ui) {
				var userBtnFlag = $(this).data("userBtnFlag");
				//alert("userFlag:"+userBtnFlag);
				if(userBtnFlag =="add"){
					$("#userIdDiv").hide();
					$("#btnUPwdModify").hide();
			        $("#btnUModify").hide();
			        $("#btnUDelete").hide();
			        $("#btnUSave").show();
			        $("#btnUCancle").hide();
			        $("#btnUClose").show();
				}else if(userBtnFlag =="show"){
					  $("#btnUPwdModify").show();
				        $("#btnUSave").hide();
				        $("#btnUModify").show();
				        $("#btnUDelete").show();
				        $("#btnUCancle").hide();
				        $("#btnUClose").show();
				}
	        },
			buttons : [
					{
						id : "btnUPwdModify",
						html : "<i class='ace-icon fa fa-pencil-square-o bigger-110'></i>&nbsp; 重置密码",
						"class" : "btn btn-purple btn-minier",
						click : function() {
							pwdModify();
						}
					},
					{
						id : "btnUModify",
						html : "<i class='ace-icon fa fa-pencil-square-o bigger-110'></i>&nbsp; 修改",
						"class" : "btn btn-primary btn-minier",
						click : function() {
							modify();
						}
					},
					{
						id : "btnUSave",
						html : "<i class='ace-icon fa fa-floppy-o bigger-110'></i>&nbsp; 确认",
						"class" : "btn btn-success btn-minier",
						click : function() {
							save();
						}
					},
					{
						id : "btnUDelete",
						html : "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; 删除",
						"class" : "btn  btn-danger btn-minier",
						click : function() {
							del();
						}
					},
					{
						id : "btnUCancle",
						html : "<i class='ace-icon fa fa-undo bigger-110'></i>&nbsp; 取消",
						"class" : "btn btn-warning btn-minier",
						click : function() {
							cancle();
						}
					},
					{
						id : "btnUClose",
						html : "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; 关闭",
						"class" : "btn btn-minier",
						click : function() {
							$(this).dialog(
									"close");
						}
					} ]
		});

});
</script>